public class addop  {
    public addop() {
    }

    public static<T> void addopt(T[] array)
    {
        int  sum =0;
        int flag =0;
        StringBuilder str= new StringBuilder();
        for (T t : array) {
            if (t instanceof Integer) {
                sum += (int) t;
                flag = 1;
            } else if (t instanceof String) {
                str.append((String) t);
                flag = 2;
            }
        }

        switch (flag) {
            case 1 -> System.out.println(sum);
            case 2 -> System.out.println(str);
            case 0 -> System.out.println("Is not integer or string.");
        }

    }

}
